package chapter02

object Test16_Array2 {
  def main(args: Array[String]): Unit = {
    //多维数组的定义
    val array = Array.ofDim[Int](2, 3)
    val array1 = Array(Array(1, 2, 3), Array(4, 5, 6), Array(7, 8, 9))
    println(array1(0)(1))
    //多维数组的遍历
    for(i<-array1){
      for(j<-i){
        println(j)
      }
    }
    array1.foreach(e=>{e.foreach(i=>{println(i)})})
    array1.foreach(_.foreach(println(_)))
  }
}
